package com.xbongbong.paas.model.impl;

import com.xbongbong.paas.domain.dao.ClueJointRecheckDao;
import com.xbongbong.paas.domain.entity.ClueJointRecheckEntity;
import com.xbongbong.paas.model.ClueJointRecheckModel;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.util.DateTimeUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author zhouwq
 * @date 2021/11/25 13:57
 */
@Service("clueJointRecheckModel")
public class CluejointRecheckModelImpl implements ClueJointRecheckModel {

    @Resource
    private ClueJointRecheckDao clueJointRecheckDao;

    @Override
    public Integer insert(ClueJointRecheckEntity clueJointRecheckEntity) throws XbbException {
        long now = DateTimeUtil.getInt();
        clueJointRecheckEntity.setAddTime(now);
        clueJointRecheckEntity.setUpdateTime(now);
        return clueJointRecheckDao.insert(clueJointRecheckEntity);
    }

    @Override
    public Integer update(ClueJointRecheckEntity clueJointRecheckEntity) {
        long now = DateTimeUtil.getInt();
        clueJointRecheckEntity.setUpdateTime(now);
        return clueJointRecheckDao.update(clueJointRecheckEntity);
    }

    @Override
    public List<ClueJointRecheckEntity> getByFormId(Long formId, String corpid) {
        return clueJointRecheckDao.getByFormId(formId, corpid);
    }

    public ClueJointRecheckEntity getByFormIdAndLinkBusinessType(Long formId, Integer linkBusinessType, String corpid) {
        return clueJointRecheckDao.getByFormIdAndLinkBusinessType(formId, linkBusinessType, corpid);
    }
    public List<ClueJointRecheckEntity>  getByFormIdListByScript(List<Long> formIdIn, List<Integer> businessTypeList, List<String> corpIdIn) {
        return clueJointRecheckDao.getByFormIdListByScript(formIdIn, businessTypeList, corpIdIn);
    }

    @Override
    public Integer deleteByForm(Long formId, String corpid) {
        return clueJointRecheckDao.deleteByForm(formId, corpid);
    }

    @Override
    public List findEntitys(Map<String, Object> param) {
        return null;
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> param) {
        return null;
    }

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return null;
    }


}
